import cv2
import numpy as np

img = cv2.imread("./img/cat.png")
# 通过 print(img) 可知图像是一个矩阵
# print(img.shape)
# (385, 413, 3) 图像的高 385 像素， 宽 413 像素,  3 个通道（B G R）

h,w,d = img.shape
# 切片
l1 = img[:,:,0] # Blue
l2 = img[:,:,1] # Green
l3 = img[:,:,2] # Red

# 伪造图层
temp_img = img.copy()
temp_img[:,:,0] = np.zeros((h,w))
temp_img[:,:,1] = np.zeros((h,w))
temp_img[:,:,2] = l3


# 展示出所有的切片层
# cv2.imshow("l1",l1)
# cv2.imshow("l2",l2)
# cv2.imshow("l3",l3)
cv2.imshow("temp",temp_img)

# 阻塞图像展示
cv2.waitKey(0)
